package com.tianya.portal.blog.controller;

import com.tianya.common.web.core.domain.AjaxResult;
import com.tianya.common.web.core.page.TableDataInfo;
import com.tianya.portal.blog.domain.BlogNewsRecall;
import com.tianya.portal.blog.service.IBlogNewsRecallService;
import com.tianya.portal.common.core.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 朝花夕拾Controller
 * 
 * @author tianya
 * @date 2023-05-10
 */
@RestController
@RequestMapping("/newsRecall")
public class BlogNewsRecallController extends BaseController
{
    @Autowired
    private IBlogNewsRecallService blogNewsRecallService;

    /**
     * 查询朝花夕拾列表
     */
    @GetMapping("/list")
    public TableDataInfo list(BlogNewsRecall blogNewsRecall)
    {
        startPage();
        List<BlogNewsRecall> list = blogNewsRecallService.selectBlogNewsRecallList(blogNewsRecall);
        return getDataTable(list);
    }

    /**
     * 获取朝花夕拾详细信息
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return success(blogNewsRecallService.selectBlogNewsRecallById(id));
    }
}
